/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import exception.SoluzioneException;
import java.awt.GridLayout;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFormattedTextField;
import schema.Coordinate;
import schema.Schema;
import schema.Simbolo;

/**
 *
 * @author Antonio
 */
public class SolverSchema extends JPanelFutoshikiModel {

    private SolverFutoshiki controllore;

    /**
     * Creates new form SolverSchema
     */
    public SolverSchema(SolverFutoshiki controllore) {

        initComponents();

        this.controllore = controllore;

        schema = new Schema();

        repaint();

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jButton2 = new JButtonSimbolTop(new Coordinate(0, 0), new Coordinate(1, 0));
        jButton3 = new JButtonSimbolTop(new Coordinate(1, 0), new Coordinate(2, 0));
        jFormattedTextField2 = new JFormattedTextFieldCoordinate(new Coordinate(0, 0));
        jFormattedTextField3 = new JFormattedTextFieldCoordinate(new Coordinate(1, 0));
        jFormattedTextField4 = new JFormattedTextFieldCoordinate(new Coordinate(2, 0));
        jFormattedTextField5 = new JFormattedTextFieldCoordinate(new Coordinate(3, 0));
        jFormattedTextField6 = new JFormattedTextFieldCoordinate(new Coordinate(4, 0));
        jButton4 = new JButtonSimbolTop(new Coordinate(2, 0), new Coordinate(3, 0));
        jButton5 = new JButtonSimbolTop(new Coordinate(3, 0), new Coordinate(4, 0));
        jButton6 = new JButtonSimbol(new Coordinate(0, 0), new Coordinate(0, 1));
        jButton7 = new JButtonSimbol(new Coordinate(1, 0), new Coordinate(1, 1));
        jButton8 = new JButtonSimbol(new Coordinate(2, 0), new Coordinate(2, 1));
        jButton9 = new JButtonSimbol(new Coordinate(3, 0), new Coordinate(3, 1));
        jButton10 = new JButtonSimbol(new Coordinate(4, 0), new Coordinate(4, 1));
        jButton15 = new JButtonSimbol(new Coordinate(0, 1), new Coordinate(0, 2));
        jButton16 = new JButtonSimbol(new Coordinate(1, 1), new Coordinate(1, 2));
        jButton17 = new JButtonSimbol(new Coordinate(2, 1), new Coordinate(2, 2));
        jButton18 = new JButtonSimbol(new Coordinate(3, 1), new Coordinate(3, 2));
        jButton19 = new JButtonSimbol(new Coordinate(4, 1), new Coordinate(4, 2));
        jFormattedTextField17 = new JFormattedTextFieldCoordinate(new Coordinate(0, 2));
        jButton20 = new JButtonSimbolTop(new Coordinate(0, 2), new Coordinate(1, 2));
        jFormattedTextField18 = new JFormattedTextFieldCoordinate(new Coordinate(1, 2));
        jButton21 = new JButtonSimbolTop(new Coordinate(1, 2), new Coordinate(2, 2));
        jFormattedTextField19 = new JFormattedTextFieldCoordinate(new Coordinate(2, 2));
        jButton22 = new JButtonSimbolTop(new Coordinate(2, 2), new Coordinate(3, 2));
        jFormattedTextField20 = new JFormattedTextFieldCoordinate(new Coordinate(3, 2));
        jButton23 = new JButtonSimbolTop(new Coordinate(3, 2), new Coordinate(4, 2));
        jFormattedTextField21 = new JFormattedTextFieldCoordinate(new Coordinate(4, 2));
        jButton24 = new JButtonSimbol(new Coordinate(0, 2), new Coordinate(0, 3));
        jButton25 = new JButtonSimbol(new Coordinate(1, 2), new Coordinate(1, 3));
        jButton26 = new JButtonSimbol(new Coordinate(2, 2), new Coordinate(2, 3));
        jButton27 = new JButtonSimbol(new Coordinate(3, 2), new Coordinate(3, 3));
        jButton28 = new JButtonSimbol(new Coordinate(4, 2), new Coordinate(4, 3));
        jFormattedTextField22 = new JFormattedTextFieldCoordinate(new Coordinate(0, 3));
        jButton29 = new JButtonSimbolTop(new Coordinate(0, 3), new Coordinate(1, 3));
        jFormattedTextField23 = new JFormattedTextFieldCoordinate(new Coordinate(1, 3));
        jButton30 = new JButtonSimbolTop(new Coordinate(1, 3), new Coordinate(2, 3));
        jFormattedTextField24 = new JFormattedTextFieldCoordinate(new Coordinate(2, 3));
        jButton31 = new JButtonSimbolTop(new Coordinate(2, 3), new Coordinate(3, 3));
        jFormattedTextField25 = new JFormattedTextFieldCoordinate(new Coordinate(3, 3));
        jButton32 = new JButtonSimbolTop(new Coordinate(3, 3), new Coordinate(4, 3));
        jFormattedTextField26 = new JFormattedTextFieldCoordinate(new Coordinate(4, 3));
        jButton33 = new JButtonSimbol(new Coordinate(4, 3), new Coordinate(4, 4));
        jButton34 = new JButtonSimbol(new Coordinate(3, 3), new Coordinate(3, 4));
        jButton35 = new JButtonSimbol(new Coordinate(2, 3), new Coordinate(2, 4));
        jButton36 = new JButtonSimbol(new Coordinate(1, 3), new Coordinate(1, 4));
        jButton37 = new JButtonSimbol(new Coordinate(0, 3), new Coordinate(0, 4));
        jFormattedTextField27 = new JFormattedTextFieldCoordinate(new Coordinate(0, 4));
        jButton38 = new JButtonSimbolTop(new Coordinate(0, 4), new Coordinate(1, 4));
        jFormattedTextField28 = new JFormattedTextFieldCoordinate(new Coordinate(1, 4));
        jButton39 = new JButtonSimbolTop(new Coordinate(1, 4), new Coordinate(2, 4));
        jFormattedTextField29 = new JFormattedTextFieldCoordinate(new Coordinate(2, 4));
        jButton40 = new JButtonSimbolTop(new Coordinate(2, 4), new Coordinate(3, 4));
        jFormattedTextField30 = new JFormattedTextFieldCoordinate(new Coordinate(3, 4));
        jButton41 = new JButtonSimbolTop(new Coordinate(3, 4), new Coordinate(4, 4));
        jFormattedTextField31 = new JFormattedTextFieldCoordinate(new Coordinate(4, 4));
        jFormattedTextField32 = new JFormattedTextFieldCoordinate(new Coordinate(0, 1));
        jButton42 = new JButtonSimbolTop(new Coordinate(0, 1), new Coordinate(1, 1));
        jFormattedTextField33 = new JFormattedTextFieldCoordinate(new Coordinate(1, 1));
        jButton43 = new JButtonSimbolTop(new Coordinate(1, 1), new Coordinate(2, 1));
        jFormattedTextField34 = new JFormattedTextFieldCoordinate(new Coordinate(2, 1));
        jButton44 = new JButtonSimbolTop(new Coordinate(2, 1), new Coordinate(3, 1));
        jFormattedTextField35 = new JFormattedTextFieldCoordinate(new Coordinate(3, 1));
        jButton45 = new JButtonSimbolTop(new Coordinate(3, 1), new Coordinate(4, 1));
        jFormattedTextField36 = new JFormattedTextFieldCoordinate(new Coordinate(4, 1));
        jLabel1 = new javax.swing.JLabel();
        jFormattedTextField1 = new javax.swing.JFormattedTextField();

        jButton1.setText("Risolvi");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Schema 5 x 5"));

        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jFormattedTextField2.setColumns(3);
        jFormattedTextField2.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField3.setColumns(3);
        jFormattedTextField3.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField4.setColumns(3);
        jFormattedTextField4.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField5.setColumns(3);
        jFormattedTextField5.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField6.setColumns(3);
        jFormattedTextField6.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField17.setColumns(3);
        jFormattedTextField17.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField18.setColumns(3);
        jFormattedTextField18.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jButton21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton21ActionPerformed(evt);
            }
        });

        jFormattedTextField19.setColumns(3);
        jFormattedTextField19.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField20.setColumns(3);
        jFormattedTextField20.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField21.setColumns(3);
        jFormattedTextField21.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField22.setColumns(3);
        jFormattedTextField22.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField23.setColumns(3);
        jFormattedTextField23.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jButton30.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton30ActionPerformed(evt);
            }
        });

        jFormattedTextField24.setColumns(3);
        jFormattedTextField24.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField25.setColumns(3);
        jFormattedTextField25.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField26.setColumns(3);
        jFormattedTextField26.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField27.setColumns(3);
        jFormattedTextField27.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField28.setColumns(3);
        jFormattedTextField28.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jButton39.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton39ActionPerformed(evt);
            }
        });

        jFormattedTextField29.setColumns(3);
        jFormattedTextField29.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField30.setColumns(3);
        jFormattedTextField30.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField31.setColumns(3);
        jFormattedTextField31.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField32.setColumns(3);
        jFormattedTextField32.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField33.setColumns(3);
        jFormattedTextField33.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jButton43.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton43ActionPerformed(evt);
            }
        });

        jFormattedTextField34.setColumns(3);
        jFormattedTextField34.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField35.setColumns(3);
        jFormattedTextField35.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jFormattedTextField36.setColumns(3);
        jFormattedTextField36.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(21, 21, 21)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField5)
                    .add(jFormattedTextField2)
                    .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jFormattedTextField3)
                    .add(jFormattedTextField4)
                    .add(jFormattedTextField6)
                    .add(jButton4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jButton7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jButton8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                    .add(jButton9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                    .add(jButton10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField35)
                    .add(jFormattedTextField32)
                    .add(jButton42, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jButton43, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jFormattedTextField33)
                    .add(jFormattedTextField34)
                    .add(jFormattedTextField36)
                    .add(jButton44, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(12, 12, 12)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jButton19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jButton18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jButton17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jButton15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jButton16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField20)
                    .add(jFormattedTextField17)
                    .add(jButton20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jButton21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jFormattedTextField18)
                    .add(jFormattedTextField19)
                    .add(jFormattedTextField21)
                    .add(jButton22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jButton25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jButton26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jButton27, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jButton28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField25)
                    .add(jFormattedTextField22)
                    .add(jButton29, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jButton30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jFormattedTextField23)
                    .add(jFormattedTextField24)
                    .add(jFormattedTextField26)
                    .add(jButton31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton37, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jButton36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jButton35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                    .add(jButton34, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
                    .add(jButton33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton41, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jFormattedTextField30)
                    .add(jFormattedTextField27)
                    .add(jButton38, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jButton39, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .add(jFormattedTextField28)
                    .add(jFormattedTextField29)
                    .add(jFormattedTextField31)
                    .add(jButton40, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 50, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                .add(jFormattedTextField2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(jButton6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jButton15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(9, 9, 9)
                        .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                .add(jFormattedTextField3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(jButton7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jButton16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(jButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                .add(jFormattedTextField4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(jButton8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jButton17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(jButton4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                .add(jFormattedTextField5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(jButton9, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jButton18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(jButton5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                .add(jFormattedTextField6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(jButton10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jButton19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(3, 3, 3)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel1Layout.createSequentialGroup()
                                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jPanel1Layout.createSequentialGroup()
                                        .add(jFormattedTextField17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                        .add(9, 9, 9)
                                        .add(jButton20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .add(jButton24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jPanel1Layout.createSequentialGroup()
                                        .add(jFormattedTextField18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                        .add(0, 0, 0)
                                        .add(jButton21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .add(jButton25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jPanel1Layout.createSequentialGroup()
                                        .add(jFormattedTextField19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                        .add(0, 0, 0)
                                        .add(jButton22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .add(jButton26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jPanel1Layout.createSequentialGroup()
                                        .add(jFormattedTextField20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                        .add(0, 0, 0)
                                        .add(jButton23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .add(jButton27, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jButton28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jFormattedTextField21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                            .add(jPanel1Layout.createSequentialGroup()
                                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(jFormattedTextField22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jButton37, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .add(9, 9, 9)
                                .add(jButton29, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(jFormattedTextField23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jButton36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .add(jButton30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(jFormattedTextField24, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jButton35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .add(jButton31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(jFormattedTextField25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jButton34, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .add(jButton32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(jFormattedTextField26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jButton33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                            .add(jPanel1Layout.createSequentialGroup()
                                .add(jFormattedTextField27, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(9, 9, 9)
                                .add(jButton38, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jFormattedTextField28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(0, 0, 0)
                                .add(jButton39, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jFormattedTextField29, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(0, 0, 0)
                                .add(jButton40, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jFormattedTextField30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(0, 0, 0)
                                .add(jButton41, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jFormattedTextField31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jPanel1Layout.createSequentialGroup()
                                .add(jFormattedTextField32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(9, 9, 9)
                                .add(jButton42, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jFormattedTextField33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(0, 0, 0)
                                .add(jButton43, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jFormattedTextField34, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(0, 0, 0)
                                .add(jButton44, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jFormattedTextField35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(0, 0, 0)
                                .add(jButton45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jFormattedTextField36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel1.setText("Num soluzioni:");

        jFormattedTextField1.setColumns(3);
        jFormattedTextField1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(jLabel1)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jFormattedTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(jButton1))
                    .add(layout.createSequentialGroup()
                        .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jButton1)
                    .add(jLabel1)
                    .add(jFormattedTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton21ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton21ActionPerformed

    private void jButton30ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton30ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton30ActionPerformed

    private void jButton39ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton39ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton39ActionPerformed

    private void jButton43ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton43ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton43ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

        if (!jFormattedTextField2.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField2.getText()), jFormattedTextField2.getCoordinata());
        }
        if (!jFormattedTextField3.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField3.getText()), jFormattedTextField3.getCoordinata());
        }
        if (!jFormattedTextField4.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField4.getText()), jFormattedTextField4.getCoordinata());
        }
        if (!jFormattedTextField5.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField5.getText()), jFormattedTextField5.getCoordinata());
        }
        if (!jFormattedTextField6.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField6.getText()), jFormattedTextField6.getCoordinata());
        }
        if (!jFormattedTextField32.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField32.getText()), jFormattedTextField32.getCoordinata());
        }
        if (!jFormattedTextField33.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField33.getText()), jFormattedTextField33.getCoordinata());
        }
        if (!jFormattedTextField34.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField34.getText()), jFormattedTextField34.getCoordinata());
        }
        if (!jFormattedTextField35.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField35.getText()), jFormattedTextField35.getCoordinata());
        }
        if (!jFormattedTextField36.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField36.getText()), jFormattedTextField36.getCoordinata());
        }
        if (!jFormattedTextField17.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField17.getText()), jFormattedTextField17.getCoordinata());
        }
        if (!jFormattedTextField18.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField18.getText()), jFormattedTextField18.getCoordinata());
        }
        if (!jFormattedTextField19.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField19.getText()), jFormattedTextField19.getCoordinata());
        }
        if (!jFormattedTextField20.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField20.getText()), jFormattedTextField20.getCoordinata());
        }
        if (!jFormattedTextField21.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField21.getText()), jFormattedTextField21.getCoordinata());
        }
        if (!jFormattedTextField22.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField22.getText()), jFormattedTextField22.getCoordinata());
        }
        if (!jFormattedTextField23.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField23.getText()), jFormattedTextField23.getCoordinata());
        }
        if (!jFormattedTextField24.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField24.getText()), jFormattedTextField24.getCoordinata());
        }
        if (!jFormattedTextField25.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField25.getText()), jFormattedTextField25.getCoordinata());
        }
        if (!jFormattedTextField26.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField26.getText()), jFormattedTextField26.getCoordinata());
        }
        if (!jFormattedTextField27.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField27.getText()), jFormattedTextField27.getCoordinata());
        }
        if (!jFormattedTextField28.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField28.getText()), jFormattedTextField28.getCoordinata());
        }
        if (!jFormattedTextField29.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField29.getText()), jFormattedTextField29.getCoordinata());
        }
        if (!jFormattedTextField30.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField30.getText()), jFormattedTextField30.getCoordinata());
        }
        if (!jFormattedTextField31.getText().isEmpty()) {

            schema.addValore(Integer.parseInt(jFormattedTextField31.getText()), jFormattedTextField31.getCoordinata());
        }

        if (jButton6.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton6.getStato(), jButton6.getCoordinataA(), jButton6.getCoordinataB()));
        }
        if (jButton7.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton7.getStato(), jButton7.getCoordinataA(), jButton7.getCoordinataB()));
        }
        if (jButton8.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton8.getStato(), jButton8.getCoordinataA(), jButton8.getCoordinataB()));
        }
        if (jButton9.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton9.getStato(), jButton9.getCoordinataA(), jButton9.getCoordinataB()));
        }
        if (jButton10.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton10.getStato(), jButton10.getCoordinataA(), jButton10.getCoordinataB()));
        }
        if (jButton15.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton15.getStato(), jButton15.getCoordinataA(), jButton15.getCoordinataB()));
        }
        if (jButton16.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton16.getStato(), jButton16.getCoordinataA(), jButton16.getCoordinataB()));
        }
        if (jButton17.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton17.getStato(), jButton17.getCoordinataA(), jButton17.getCoordinataB()));
        }
        if (jButton18.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton18.getStato(), jButton18.getCoordinataA(), jButton18.getCoordinataB()));
        }
        if (jButton19.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton19.getStato(), jButton19.getCoordinataA(), jButton19.getCoordinataB()));
        }
        if (jButton20.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton20.getStato(), jButton20.getCoordinataA(), jButton20.getCoordinataB()));
        }
        if (jButton21.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton21.getStato(), jButton21.getCoordinataA(), jButton21.getCoordinataB()));
        }
        if (jButton22.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton22.getStato(), jButton22.getCoordinataA(), jButton22.getCoordinataB()));
        }
        if (jButton23.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton23.getStato(), jButton23.getCoordinataA(), jButton23.getCoordinataB()));
        }
        if (jButton24.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton24.getStato(), jButton24.getCoordinataA(), jButton24.getCoordinataB()));
        }
        if (jButton25.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton25.getStato(), jButton25.getCoordinataA(), jButton25.getCoordinataB()));
        }
        if (jButton26.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton26.getStato(), jButton26.getCoordinataA(), jButton26.getCoordinataB()));
        }
        if (jButton27.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton27.getStato(), jButton27.getCoordinataA(), jButton27.getCoordinataB()));
        }
        if (jButton28.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton28.getStato(), jButton28.getCoordinataA(), jButton28.getCoordinataB()));
        }
        if (jButton29.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton29.getStato(), jButton29.getCoordinataA(), jButton29.getCoordinataB()));
        }
        if (jButton30.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton30.getStato(), jButton30.getCoordinataA(), jButton30.getCoordinataB()));
        }
        if (jButton31.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton31.getStato(), jButton31.getCoordinataA(), jButton31.getCoordinataB()));
        }
        if (jButton32.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton32.getStato(), jButton32.getCoordinataA(), jButton32.getCoordinataB()));
        }
        if (jButton33.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton33.getStato(), jButton33.getCoordinataA(), jButton33.getCoordinataB()));
        }
        if (jButton34.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton34.getStato(), jButton34.getCoordinataA(), jButton34.getCoordinataB()));
        }
        if (jButton35.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton35.getStato(), jButton35.getCoordinataA(), jButton35.getCoordinataB()));
        }
        if (jButton36.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton36.getStato(), jButton36.getCoordinataA(), jButton36.getCoordinataB()));
        }
        if (jButton37.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton37.getStato(), jButton37.getCoordinataA(), jButton37.getCoordinataB()));
        }
        if (jButton38.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton38.getStato(), jButton38.getCoordinataA(), jButton38.getCoordinataB()));
        }
        if (jButton39.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton39.getStato(), jButton39.getCoordinataA(), jButton39.getCoordinataB()));
        }
        if (jButton40.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton40.getStato(), jButton40.getCoordinataA(), jButton40.getCoordinataB()));
        }
        if (jButton41.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton41.getStato(), jButton41.getCoordinataA(), jButton41.getCoordinataB()));
        }
        if (jButton42.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton42.getStato(), jButton42.getCoordinataA(), jButton42.getCoordinataB()));
        }
        if (jButton43.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton43.getStato(), jButton43.getCoordinataA(), jButton43.getCoordinataB()));
        }
        if (jButton44.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton44.getStato(), jButton44.getCoordinataA(), jButton44.getCoordinataB()));
        }
        if (jButton45.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton45.getStato(), jButton45.getCoordinataA(), jButton45.getCoordinataB()));
        }
        if (jButton3.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton3.getStato(), jButton3.getCoordinataA(), jButton3.getCoordinataB()));
        }
        if (jButton2.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton2.getStato(), jButton2.getCoordinataA(), jButton2.getCoordinataB()));
        }
        if (jButton4.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton4.getStato(), jButton4.getCoordinataA(), jButton4.getCoordinataB()));
        }
        if (jButton5.getStato() != null) {
            schema.addSimbolo(new Simbolo(jButton5.getStato(), jButton5.getCoordinataA(), jButton5.getCoordinataB()));
        }
        try {

            risolvi(jFormattedTextField1.getText().isEmpty() ? 1 : Integer.parseInt(jFormattedTextField1.getText()), schema);

            controllore.remove(this);
            controllore.addSoluzione(getSoluzioni(), schema.getSimboli());
        } catch (SoluzioneException ex) {

            System.out.println("Schema vuoto");
        }
    }//GEN-LAST:event_jButton1ActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private gui.JButtonSimbol jButton10;
    private gui.JButtonSimbol jButton15;
    private gui.JButtonSimbol jButton16;
    private gui.JButtonSimbol jButton17;
    private gui.JButtonSimbol jButton18;
    private gui.JButtonSimbol jButton19;
    private gui.JButtonSimbolTop jButton2;
    private gui.JButtonSimbolTop jButton20;
    private gui.JButtonSimbolTop jButton21;
    private gui.JButtonSimbolTop jButton22;
    private gui.JButtonSimbolTop jButton23;
    private gui.JButtonSimbol jButton24;
    private gui.JButtonSimbol jButton25;
    private gui.JButtonSimbol jButton26;
    private gui.JButtonSimbol jButton27;
    private gui.JButtonSimbol jButton28;
    private gui.JButtonSimbolTop jButton29;
    private gui.JButtonSimbolTop jButton3;
    private gui.JButtonSimbolTop jButton30;
    private gui.JButtonSimbolTop jButton31;
    private gui.JButtonSimbolTop jButton32;
    private gui.JButtonSimbol jButton33;
    private gui.JButtonSimbol jButton34;
    private gui.JButtonSimbol jButton35;
    private gui.JButtonSimbol jButton36;
    private gui.JButtonSimbol jButton37;
    private gui.JButtonSimbolTop jButton38;
    private gui.JButtonSimbolTop jButton39;
    private gui.JButtonSimbolTop jButton4;
    private gui.JButtonSimbolTop jButton40;
    private gui.JButtonSimbolTop jButton41;
    private gui.JButtonSimbolTop jButton42;
    private gui.JButtonSimbolTop jButton43;
    private gui.JButtonSimbolTop jButton44;
    private gui.JButtonSimbolTop jButton45;
    private gui.JButtonSimbolTop jButton5;
    private gui.JButtonSimbol jButton6;
    private gui.JButtonSimbol jButton7;
    private gui.JButtonSimbol jButton8;
    private gui.JButtonSimbol jButton9;
    private javax.swing.JFormattedTextField jFormattedTextField1;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField17;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField18;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField19;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField2;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField20;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField21;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField22;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField23;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField24;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField25;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField26;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField27;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField28;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField29;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField3;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField30;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField31;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField32;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField33;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField34;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField35;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField36;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField4;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField5;
    private gui.JFormattedTextFieldCoordinate jFormattedTextField6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
}
